<template>
  <van-tabbar route v-model="active">
    <template v-for="item in list">
      <van-tabbar-item
        :key="item.path"
        replace
        :to="item.path"
        :icon="item.icon"
      >
        {{ item.text }}
      </van-tabbar-item>
    </template>
  </van-tabbar>
</template>

<script>
export default {
  data() {
    return {
      active: 0,
      list: [
        {
          path: '/layout/home',
          text: '首页',
          icon: 'home-o',
        },
        {
          path: '/layout/classify',
          text: '分类',
          icon: 'notes-o',
        },
        {
          path: '/layout/cart',
          text: '购物车',
          icon: 'cart-o',
        },
      ],
    }
  },
}
</script>

<style></style>
